Skip to main content

EvaluateConstantExpression

Type

statement

Summary

Evaluates an expression. Expr:The expression to evaluate.

Syntax

evaluate constant expression <Script>

Description

Evaluates any constant LiveCode Script expression. A constant LiveCode script expression is any expression which can appear as an initializer for local and constant declarations.

If an error occurs when either parsing the expression, or evaluating the expression, no error is thrown and nothing is returned.

Examples

public handler GetExpressionResult()
variable tResult
evaluate constant expression "2 + 2" into tResult
-- tResult should now hold "4"
return tResult
end handler
Thank you for your feedback!

Was this page helpful?